<!-- Main block start -->

<section class="clearfix row">
  <div class="col-xs-12">
	<div class="clearfix">
		<ul class="nav nav-tabs no-bor h3">
		<% 
			var i = 0;
			if (list.models.length > 0 ) { 
				_.each(list.models, function(email_tempalte) {				
					var settings = email_tempalte.get('template');
		%>
				<li <% if (!_.isUndefined(id) && id == email_tempalte.get('id')) { %>class="active" <%} else if (_.isUndefined(id) && email_tempalte.get('id') == 1) { %>class="active" <%}%> ><a href="#/email_templates/<%-email_tempalte.get('id')%>"><%- i18next.t(email_tempalte.get('display_name')) %></a></li>
		<% 
					i++;
				});
			} 
		%>
		</ul>
	</div>
	
	<div class="row">
		<div class="tab-content col-sm-10">
		<% if (list.models.length > 0 ) { 
				var j = 0;
				_.each(list.models, function(email_tempalte) {	
					var template = email_tempalte.get('template');
		%>		
				<div class="modal-body tab-pane clearfix <% if (!_.isUndefined(id) && id == email_tempalte.get('id')) { %> active <%} else if (_.isUndefined(id) && email_tempalte.get('id') == 1) { %> active <%}%>" id="settingTab<%- email_tempalte.get('id') %>">
					<% if(!_.isEmpty(template)){ %>
					<p class="alert alert-info "><%- i18next.t(template.description) %></p>
					<form class="form-horizontal js-email-templates-form" role="form" id="js-email-templates-form">
					  <div class="form-group">
						 <label for="inputFromEmail" class="col-md-2 col-sm-3 control-label"><%- i18next.t("From") %></label>
						 <div class="col-md-4 col-sm-9">
							<input type="text" id="inputFromEmail" name="from_email" class="form-control" value="<%- template.from_email %>" />
						 </div>
					  </div>
					  <div class="form-group">
						 <label for="inputReplyToEmail" class="col-md-2 col-sm-3 control-label"><%- i18next.t("Reply To") %></label>
						 <div class="col-md-4 col-sm-9">
							<input type="text" id="inputReplyToEmail" name="reply_to_email" class="form-control" value="<%- template.reply_to_email %>" />
						 </div>
					  </div>
					  <div class="form-group">
						 <label for="inputSubject" class="col-md-2 col-sm-3 control-label"><%- i18next.t("Subject") %></label>
						 <div class="col-md-4 col-sm-9">
							<input type="text" id="inputSubject" name="subject" class="form-control" value="<%- template.subject %>" />
							<span class="info"><%- template.email_variables %></span>
						 </div>
					  </div>
					  <div class="form-group">
						 <label class="col-md-2 col-sm-3 control-label" for="EmailTemplateEmailTextContent"><%- i18next.t("Email Content") %></label>
						<div class="col-md-10 col-sm-9">
							<textarea id="EmailTemplateEmailTextContent" class="form-control" name="email_text_content"	rows="20"><%- template.email_text_content %></textarea>
							<span class="info"><%- template.email_variables %></span>
						</div>
					  </div>
					  <div class="form-group">
						<label for="submit2" class="sr-only col-md-2 col-sm-3 control-label"><%- i18next.t("Submit") %></label>
						<div class="col-md-4 col-sm-9">
						<input type="submit" value="<%- i18next.t('Update') %>" id="submit2" class="btn btn-primary">
						</div>
					  </div>
					</form>
					<% } %>
				</div>
		<% 
					j++;
				});
			} 
		%>				
		</div>
	</div>
  </div>
</section>
<!-- Main block end -->